package cn.lovecyy.mockjson.core.funcs;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

/**
 * FuncMockRegistry
 *
 * @author Yakir
 */
public class FuncMockRegistry {

	private static final Map<String, FuncMock> registry = new HashMap<>();
	static {
		// 注册时间格式化函数
		register(new DateFormatFunc());
		register(new ToUpperCaseFunc());
		register(new ToLowerCaseFunc());
		register(new PrefixFunc());
		register(new SuffixFunc());
		register(new SubFunc());

	}

	public static void register(FuncMock mocker) {
		registry.put(mocker.getFuncName(), mocker);
	}

	public static FuncMock get(String funcName) {
		return registry.get(funcName);
	}

}
